﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master"
    Inherits="System.Web.Mvc.ViewPage<HYBYSoft.Company.Models.QuestionAndReplyMessages>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content">
        <div id="message">
            <table>
                <tr>
                    <td>
                        <p>
                            问题内容：<%:Model.Titles%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提问时间：<%:Model.CreateTime.ToString() %>
                        </p>
                    </td>
                </tr>
            </table>
            <div id="div_list">
                <%if (Model.ReplyMessages.Count() == 0)
                  {
                      Html.RenderPartial("partialNoneDate");
                  }
                  else
                  {
                      var grid = new WebGrid(source: Model.ReplyMessages); %>
                <%=grid.GetHtml(tableStyle: "grid", headerStyle: "header", footerStyle: "footer", rowStyle: "row", alternatingRowStyle: "alt", mode: WebGridPagerModes.All, columns: new WebGridColumn[]{
                    new WebGridColumn{ Header="问题/回复", Format=item=>((ReplyMessage)((WebGridRow)item).Value).Contents, Style="titlecolumn a"},
                    new WebGridColumn{ Header="创建时间", Format=item=>((ReplyMessage)((WebGridRow)item).Value).CreateTime.ToString()},
                    new WebGridColumn{ Header="回复/提问人",Format=item=>((ReplyMessage)((WebGridRow)item).Value).IsAdmin==0?"游客":"管理员"}})
                %>
                <%} %>
            </div>
        </div>
        <p>
            <%: Html.ActionLink("返回留言管理首页", "Index") %>
        </p>
    </div>
</asp:Content>
